<template>
  <div class="page">
    <div class="tab-wrap">
      <div class="tab" :class="tabValid ? 'tab-active' : ''" @click="tabValid=true;tabOverdue=false">生效中</div>
      <div class="tab" :class="tabOverdue ? 'tab-active' : ''" @click="tabValid=false;tabOverdue=true">已过期</div>
    </div>
    <div class="no-data-wrap" style="display:none;">
      <img src="../../assets/img/pic_nocoupons_mycoupon@2x.png" alt="">
      <span>暂无优惠券</span>
    </div>
    <div class="coupon-wrap">
      <div class="coupon-box">
        <div class="summary-box" @click="toDetail()">
          <div class="main-content">
            <h3>免费2小时优惠券</h3>
            <span>购买费用:800元&nbsp;可发放期至:2019-12-31 23:59:59</span>
          </div>
          <img src="../../assets/img/ic/skip@2x.png" alt="">
        </div>
        <div class="data-box">
          <div class="item">
            <span class="item-text">购买数量</span>
            <span class="item-num">100张</span>
          </div>
          <div class="item">
            <span class="item-text">发放数量</span>
            <span class="item-num">0张</span>
          </div>
          <div class="item">
            <span class="item-text">使用数量</span>
            <span class="item-num">0张</span>
          </div>
          <div class="item">
            <span class="item-text">已退数量</span>
            <span class="item-num">0张</span>
          </div>
          <div class="item" style="margin-bottom:0px;">
            <span class="item-text">剩余可发放数量</span>
            <span class="item-num">100张</span>
          </div>
        </div>
      </div>
      <div class="coupon-box">
        <div class="summary-box">
          <div class="main-content">
            <h3>免费2小时优惠券</h3>
            <span>购买费用:800元&nbsp;可发放期至:2019-12-31 23:59:59</span>
          </div>
          <img src="../../assets/img/ic/skip@2x.png" alt="">
        </div>
        <div class="data-box">
          <div class="item">
            <span class="item-text">购买数量</span>
            <span class="item-num">100张</span>
          </div>
          <div class="item">
            <span class="item-text">发放数量</span>
            <span class="item-num">0张</span>
          </div>
          <div class="item">
            <span class="item-text">使用数量</span>
            <span class="item-num">0张</span>
          </div>
          <div class="item">
            <span class="item-text">已退数量</span>
            <span class="item-num">0张</span>
          </div>
          <div class="item" style="margin-bottom:0px;">
            <span class="item-text">剩余可发放数量</span>
            <span class="item-num">100张</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data(){
      return {
        title: '我的优惠券', 
        tabValid: true,
        tabOverdue: false
      }
    },
    created() {
      this.$store.commit("setTitle", this.title);
      this.$store.commit("setShowCloseBtn", false);
    },
    methods: {
      toDetail(){
        this.$router.push({path:'/myCouponDetail'})
      }
    }
  }
</script>

<style lang="less">
.tab-wrap{
  height: 90px;
  background: #fff;
  display: flex;
  padding: 0px 30px;
  .tab{
    line-height: 90px;
    flex-grow: 1;
    text-align: center;
    font-size: 28px;
    color: #696969;
    letter-spacing: 0;
    cursor: pointer;
  }
  .tab-active{
    color: #1875ED;
    border-bottom: 5px solid #1875ED;
  }
}
.no-data-wrap{
  margin-top: 280px;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  img{
    width: 320px;
    height: 320px;
  }
  span{
    width: 320px;
    text-align: left;
    font-size: 30px;
    color: #696969;
    letter-spacing: 0; 
    padding-left: 65px;
  }
}
.coupon-wrap{
  margin-top: 20px;
  width: 100%;
  height: auto;
  padding: 0 20px;
  .coupon-box{
    width: 710px;
    height: 470px;
    background: #fff;
    background: #FFFFFF;
    box-shadow: 0 3px 14px 0 rgba(0,0,0,0.08);
    border-radius: 8px;
    margin-bottom: 20px;
    .summary-box{
      height: 130px;
      display: flex;
      align-items:center;
      justify-content:space-between;
      border-bottom: 2px dashed #e1e1e1;
      padding: 0px 30px;
      .main-content{
        display: flex;
        justify-content: center;
        flex-direction: column;
        height: 130px;
        line-height: 130px;
        h3{
          font-size: 34px;
          color: #262626;
          height: 32px;
          line-height: 32px;
          margin-bottom: 15px;
        }
        span{
          font-size: 24px;
          color: #ABABAB;
          letter-spacing: 0.92px;
          height: 24px;
          line-height: 24px;
        }
      }
      img{
        width: 48px;
        height: 48px;
      }
    }
    .data-box{
      height: 340px;
      padding: 37px 30px;
      .item{
        display: flex;
        justify-content: space-between;
        margin-bottom: 32px;
        .item-text{
          font-size: 28px;
          color: #696969;
          letter-spacing: 0;
          line-height: 28px;
        }
        .item-num{
          font-size: 28px;
          color: #262626;
          letter-spacing: 0;
          line-height: 28px;
        }
      }
    }
  }
}
</style>
